<%@ page contentType="text/html;charset=utf-8" %>
<%@ page language="java" import="weibo4j.http.*" %>
<%@ page language="java" import="weibo4j.*" %>
<%@ page language="java" import="java.util.List"%>

<%@ page language="java" import="weibo4j.Status"%>

<%@ page language="java" import="weibo4j.WeiboException"%>

<%@ page language="java" import="weibo4j.Weibo"%>


<jsp:useBean id="weboauth" scope="session" class="weibo4j.examples.WebOAuth" />
<%
AccessToken accessToken = (AccessToken)session.getAttribute("accessToken");
String weiboText = (String)request.getParameter("weiboText");
System.out.print(weiboText);
// 连续发表同样的微博内容会返回400错误

try {
			Weibo weibo = new Weibo();
			weibo.setToken(accessToken.getToken(),accessToken.getTokenSecret());
//			int page=1;
			//page做翻页处理
			
			List<Status> list = weibo.getFavorites(1);
			for(Status status : list) {
			%>
			<div><%=status.getText() %></div>
			<%	System.out.println(status.toString());
			}
		} catch (WeiboException e) {
			e.printStackTrace();
		}
%> 